<?php
/**
 * @see http://code.google.com/p/jstal/wiki/usage
 */

$data = array(
        'title' => "JSTAL test",
        'features' => array(
                array('name'=>"define", 'status'=>"buggy"),
                array('name'=>"condition", 'status'=>"implemented"),
                array('name'=>"repeat", 'status'=>"partially implemented"),
                array('name'=>"content", 'status'=>"implemented"),
                array('name'=>"replace", 'status'=>"implemented"),
                array('name'=>"attributes", 'status'=>";; not supported"),
                array('name'=>"omit-tag", 'status'=>"implemented")
        ),
        'weekdays' => array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),
        'today' => "function()array(
                var d = new Date();
                return d.getFullYear() + '/' + (d.getMonth()+1) + '/' + d.getDate();
        ",
        'truecondition' => 1,
        'linkAttributes' => array(
                'classname' => "important",
                'style'=> "border:1px solid #f00; background:#dff;  display: block; padding:20px",
                'href'=>"http://code.google.com/p/jstal/"
        )
);
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
require_once 'MicroTal.php';
$tal = new MicroTal('./');
$tal->pagedata = $data;
$tal->request = array(
    'rows' => 5,
    'cols' => 15,
);
$obj = new stdClass();
$obj->sub = array('absolute_url' => 'http://blog.purevirtual.net');
$tal->here = $obj;
echo $tal->execute("example2.xhtml");